package com.hzw.subject.common.enums;

import lombok.Getter;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2025/2/10 15:33
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(500,"失败");

    private int code;
    public String desc;

    ResultCodeEnum(int i, String desc) {
        this.code=code;
        this.desc=desc;
    }

    public static ResultCodeEnum getByCode(int codeVal){
        for(ResultCodeEnum resultCodeEnum:ResultCodeEnum.values()){
            if(resultCodeEnum.code==codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }
}
